<?php
	#include_once('../func_dbc.php');
	//check existence of cookies
	if ((!(isset($_COOKIE["myemail"])))|| (!(isset($_COOKIE["mypassword"] ))))
	{
		header("Location: /huasheng");
		exit;
	}
	
	$myemail = $_COOKIE["myemail"];
	$mypassword = $_COOKIE["mypassword"];
	

	//verify existence of username and password
	$sql="SELECT * FROM $t_users t1 join $t_salt t2 on t1.saltId = t2.saltId 
	WHERE t1.email='$myemail' and t2.password='$mypassword';";

	$result = @mysql_query($sql);
	$row = mysql_fetch_row($result);
	$num = mysql_num_rows($result); 
	
	// if the list is empty, back to login page
	if ($num == 0)
	{
		
		header("Location: /huasheng");
		exit;
	}	
?>